﻿using System;
using System.Windows.Data;

namespace FastMVVM.Core
{
    /// <summary>
    /// It can be used to see what is been send or receve by the Binding.
    /// Use as a Converter at XAML Binding.
    /// </summary>
    public class DebugBinding : IValueConverter
    {
        /// <summary>
        /// See what is been sending from ViewModel to View.
        /// </summary>
        /// <param name="value">The object that is been sending.</param>
        /// <param name="targetType">Type of the object that is been sending.</param>
        /// <param name="parameter"></param>
        /// <param name="culture"></param>
        /// <returns></returns>
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            System.Diagnostics.Debugger.Break();
            return value;
        }

        /// <summary>
        /// See what is been sending from View to ViewModel
        /// </summary>
        /// <param name="value">The object that is been sending.</param>
        /// <param name="targetType">Type of the object that is been sending.</param>
        /// <param name="parameter"></param>
        /// <param name="culture"></param>
        /// <returns></returns>
        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            System.Diagnostics.Debugger.Break();
            return value;
        }
    }
}
